#define _CRT_SECURE_NO_WARNINGS 1

#include "SList.h"

void TestSLT1()
{
	SLNode* plist = NULL;
	//SLTPushBack(&plist, 1);
	//SLTPushBack(&plist, 2);
	//SLTPushBack(&plist, 3);
	//SLTPushBack(&plist, 4);
	//SLTPrint(plist);
	SLTPushFront(&plist, 10);
	SLTPushFront(&plist, 20);
	SLTPushFront(&plist, 30);
	SLTPushFront(&plist, 40);
	SLTPrint(plist);

}
void TestSLT2()
{
	SLNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);

	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPrint(plist);
	SLTPopBack(&plist);

	SLTPrint(plist);
}
void TestSLT3()
{
	SLNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	SLTPopFront(&plist);
	SLTPrint(plist);
	SLTPopFront(&plist);
	SLTPrint(plist);
	SLTPopFront(&plist);
	SLTPrint(plist);	
	SLTPopFront(&plist);
	SLTPrint(plist);
	//SLTPopFront(&plist);
	//SLTPrint(plist);
}
void TestSLT4()
{
	SLNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	
	SLNode* pos = SLTFind(plist, 2);
	if (pos != NULL)
	{
		SLTInsert(&plist, pos, 10);
	}
	SLTPrint(plist);
	SLTErase(&plist, pos);
	SLTPrint(plist);

	SLTDestroy(&plist);
}

int main()
{
	TestSLT4();
}